package com.jww.mapper;

import com.jww.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Select("select * from user")
    List<User> findAll();

    //新增方法
    @Insert("insert into user values(id,#{username},#{email})")
    void insert(String username, String email);

    //删除
    void deleteById(String id);

    //修改
    void update(String id, String username, String email);

    @Select("select * from user where id =#{id}")
    User selectById(int id);

}
